using System;
using System.Linq.Expressions;
using AzureDiagMon.Common.Mvvm;
using AzureDiagMon.Common.Mvvm.Interfaces;
using Ninject;

namespace AzureDiagMon.ViewModels
{
    [ViewModel("LogEntryDetailsViewModel")]
    public class LogEntryDetailsViewModel : ViewModel
    {
        [Inject]
        public MainViewModel Main { get; private set; }

        public LogEntryDetailsViewModel()
        {
            if (IsInDesignMode)
            {

            }
            else
            {

            }
        }

        #region Extended RaisePropertyChanged

        private void RaisePropertyChanged(Expression<Func<LogEntryDetailsViewModel, string>> selector)
        {
            var propertyName = ((MemberExpression)selector.Body).Member.Name;
            if (!String.IsNullOrEmpty(propertyName))
                RaisePropertyChanged(propertyName);
        }

        #endregion
    }
}